package com.yjhb.android.sbz.v2.mvp.presenter

import com.yjhb.android.sbz.v2.mvp.V2ConventionPresenter
import com.jojo.android.zxlib.base.mvp.BaseView


/**
 *  创建者 zx
 *  创建时间 2021/7/12 10:04
 */
class OSSPresenter(v: BaseView) : V2ConventionPresenter<BaseView>(v) {

    fun getToken(): String? {
        val ob = model?.getOssToken()
        val result = ob?.blockingSingle()
        result?.let {
            if (it.code == 200) {
                return it.data
            } else {
                view?.onFailure(it.code, it.message)
            }
        }
        return null
    }

}